# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName:   Auto_api_model
# FileName:      read_json.py
# Author:       xgy
# Datetime:     2025/9/13 09:30
# Description:
# ---------------------------------------------------------------------------
import json
import os.path


def read_json(path_file):
    if isinstance(path_file,str) and os.path.isfile(path_file) and path_file.endswith(".json"):

        try:
            with open(path_file,mode="r",encoding="utf-8") as f:
                return json.load(f)
        except Exception as e:
            # TODO
            raise e
    else:
        return FileNotFoundError("json文件路径错误")




